#include <algorithm>
#include <cstdio>

const int N = 100005;
int n, q, cnt, dfn[N], son[N], dep[N], top[N], fa[N], siz[N];
int e_cnt, heads[N];

struct Edge {
  int v, nxt;
} e[N << 1];

struct Node {
  bool sig;
  int tag;
} tr[N << 2];

inline void add(int u, int v) {
  e[++e_cnt].v = v, e[e_cnt].nxt = heads[u], heads[u] = e_cnt;
}

void dfs1(int x) {
  siz[x] = 1;
  for (int i = heads[x], v; i; i = e[i].nxt) {
    if ((v = e[i].v) != fa[x]) {
      fa[v] = x, dep[v] = dep[x] + 1;
      dfs1(v);
      siz[x] += siz[v];
      if (siz[son[x]] < siz[v]) son[x] = v;
    }
  }
}

void dfs2(int x) {
  dfn[x] = ++cnt;
  if (son[x]) top[son[x]] = top[x], dfs2(son[x]);
  for (int i = heads[x], v; i; i = e[i].nxt) {
    if ((v = e[i].v) != fa[x] && v != son[x]) {
      top[v] = v;
      dfs2(v);
    }
  }
}

inline void pushup(int x) { tr[x].sig = tr[x << 1].sig | tr[x << 1 | 1].sig; }

inline void pushdown(int x) {
  int ls, rs;
  if (tr[x].tag != -1) {
    ls = x << 1, rs = x << 1 | 1;
    tr[ls].tag = tr[rs].tag = tr[x].tag;
    tr[ls].sig = tr[rs].sig = tr[x].tag;
    tr[x].tag = -1;
  }
}

void modify(int x, int l, int r, int L, int R, bool v) {
  if (L <= l && r <= R) return tr[x].tag = tr[x].sig = v, void();
  int mid = (l + r) >> 1;
  pushdown(x);
  if (L <= mid) modify(x << 1, l, mid, L, R, v);
  if (mid < R) modify(x << 1 | 1, mid + 1, r, L, R, v);
  pushup(x);
}

bool query(int x, int l, int r, int L, int R) {
  if (L <= l && r <= R) return tr[x].sig;
  int mid = (l + r) >> 1;
  pushdown(x);
  bool res = false;
  if (L <= mid) res |= query(x << 1, l, mid, L, R);
  if (mid < R) res |= query(x << 1 | 1, mid + 1, r, L, R);
  return res;
}

inline void modifychain(int x, int y, bool v) {
  while (top[x] != top[y]) {
    if (dep[top[x]] < dep[top[y]]) std::swap(x, y);
    modify(1, 1, n, dfn[top[x]], dfn[x], v);
    x = fa[top[x]];
  }
  if (dep[x] > dep[y]) std::swap(x, y);
  modify(1, 1, n, dfn[x], dfn[y], v);
}

inline bool querychain(int x, int y) {
  bool res = false;
  while (top[x] != top[y]) {
    if (dep[top[x]] < dep[top[y]]) std::swap(x, y);
    res |= query(1, 1, n, dfn[top[x]], dfn[x]);
    x = fa[top[x]];
  }
  if (dep[x] > dep[y]) std::swap(x, y);
  res |= query(1, 1, n, dfn[x], dfn[y]);
  return res;
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("inter.in", "r", stdin);
  freopen("inter.out", "w", stdout);
#endif
#endif

  scanf("%d", &n);
  for (int i = 1, u, v; i < n; ++i) {
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  top[1] = 1, dep[1] = 1, fa[1] = 1;
  dfs1(1), dfs2(1);
  for (int i = 1; i <= n << 2; ++i) tr[i].tag = -1;
  scanf("%d", &q);
  for (int a, b, c, d; q; q--) {
    scanf("%d%d%d%d", &a, &b, &c, &d);
    modifychain(a, b, true);
    puts(querychain(c, d) ? "YES" : "NO");
    modifychain(a, b, false);
  }
  return 0;
}